"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from .views import IndexViews,UsersViews,TypesViews,GoodsViews,AuthViews,OrdersViews

urlpatterns = [
   

    # 后台首页
    url(r'^$', IndexViews.index,name='myadmin_index'),
    # 后台登录页面
    url(r'^login/$',IndexViews.mylogin,name="myadmin_login"),
    url(r'^logout/$',IndexViews.mylogout,name="myadmin_logout"),


    # 订单管理
    url(r'^order/list/$',OrdersViews.orderlist,name='myadmin_order_list'),
    # 订单详情
    url(r'^order/info/(?P<oid>[0-9]+)/$',OrdersViews.orderinfo,name='myadmin_order_info'),
    # 订单修改
    url(r'^order/edit/(?P<oid>[0-9]+)/$',OrdersViews.orderedit,name='myadmin_order_edit'),

    # 后台权限管理
        # 后台用户添加
    url(r'^auth/user/add/$',AuthViews.useradd,name='auth_user_add'),
        # 后台用户列表
    url(r'^auth/user/list/$',AuthViews.userlist,name='auth_user_list'),
    url(r'^auth/user/del/(?P<uid>[0-9]+)/$',AuthViews.userdel,name='auth_user_del'),
        # 后台用户修改
    url(r'^auth/user/edit/(?P<uid>[0-9]+)/$',AuthViews.useredit,name='auth_user_edit'),
        # 后台组添加
    url(r'^auth/group/add/$',AuthViews.groupadd,name='auth_group_add'),
        # 后台组列表
    url(r'^auth/group/list/$',AuthViews.grouplist,name='auth_group_list'),
    url(r'^auth/group/edit/(?P<gid>[0-9]+)/$',AuthViews.groupedit,name='auth_group_edit'),



    # 会员管理
                # 添加会员
    url(r'^user/add/$', UsersViews.useradd,name='myadmin_user_add'),
                # 插入数据
    url(r'^user/insert/$', UsersViews.userinsert,name='myadmin_user_insert'),
                #　显示数据
    url(r'^user/index/$', UsersViews.userindex,name='myadmin_user_index'),
                #　删除数据
    url(r'^user/del/(?P<uid>[0-9]+)/$', UsersViews.userdel,name='myadmin_user_del'),
                #　修改获取数据
    url(r'^user/edit/(?P<uid>[0-9]+)/$', UsersViews.useredit,name='myadmin_user_edit'),
                #　修改数据
    url(r'^user/update/$', UsersViews.userupdate,name='myadmin_user_update'),

    
    # 分类管理
                # 添加分类
    url(r'^types/add/$',  TypesViews.typesadd,name="myadmin_types_add"),
                # 插入分类
    url(r'^types/insert/$',  TypesViews.typesinsert,name="myadmin_types_insert"),
                # 分类列表
    url(r'^types/index/$',  TypesViews.typesindex,name="myadmin_types_index"),
                # 删除分类
    url(r'^types/delete/$',  TypesViews.typesdelete,name="myadmin_types_delete"),
                # 修改分类名
    url(r'^types/update/$',  TypesViews.typesupdate,name="myadmin_types_update"),

   # 商品管理
                # 添加分类
    url(r'^goods/add/$',  GoodsViews.goodsadd,name="myadmin_goods_add"),
                # 插入分类
    url(r'^goods/insert/$',  GoodsViews.goodsinsert,name="myadmin_goods_insert"),
                # 分类列表
    url(r'^goods/index/$',  GoodsViews.goodsindex,name="myadmin_goods_index"),
                # 删除分类
    url(r'^goods/delete/(?P<uid>[0-9]+)/$',  GoodsViews.goodsdelete,name="myadmin_goods_delete"),
                # 修改
    url(r'^goods/edit/(?P<uid>[0-9]+)/$',GoodsViews.goodsedit,name='myadmin_goods_edit'),
                #　修改数据
    url(r'^goods/update/$',GoodsViews.goodsupdate,name='myadmin_goods_update'),


]
